<script type="text/javascript">
$(function(){
	$.get("applicationSingle/getCardInfo",function(data){
		var content="<option value='' selected>请选择</option>";
		$(data).each(function(n,item){
			for(var i=0;i<item.certificates.length;i++){
				content+="<option value="+item.certificates[i].certificateType+">"
				+item.certificates[i].certificatesName+"</option>"
			}
			$("#paperTypeByUpdatePersonal").html(content);
		});
	},"json");
	
});

function queryPersonalInfo(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		if(json.length==0){
			content+="<tr><td colspan='3' align='center' >未查询到数据</td></tr>"
		}else{
			for(var i=0;i<json.length;i++){
				var paperTypeName=""
				$("#paperTypeByUpdatePersonal").find("option").each(function(n,item){
					var type=$(item).val();
					if(type==json[i].paperType){
						paperTypeName=$(item).text()
					}
				})
				var value=json[i].paperType+"#"+json[i].paperNo+"#"+json[i].mobile
				content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td><input name='personalInfo' onclick='test(this)' value="+value+" type='radio'></td><td>"+
				json[i].customerName+"</td><td>"+paperTypeName+"</td><td>"+json[i].paperNo+"</td><td>"+json[i].mobile+"</td></tr>"
			}   
		}	
		$("#tbodyByPersonalInfo").html(content)
		$("#totalCountBypersonalInfo").text("共"+json.length+"条")
		var $p = $("#ByPersonalInfo");
		initUI($p);
	}		
}

function validateChechBoxByUpdataPersonal(){
	 if($("input[name='personalInfo']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	 }
	 if($("input[name='personalInfo']:checked").length > 1){
		 alertMsg.warn("不能多于一条数据！")
		 return false;
	 }
	
}
</script>
<div class="pageHeader ">
	<form id="pagerForm" method="post" action="personalInfo/queryPersonalInfo" class="pageForm required-validate" onsubmit="return validateCallback(this,queryPersonalInfo);">
		<div class="searchBar" >
		<div class="row" style="padding: 0 10px;">
		<div class="col-md-4 col-sm-12" >
			<p><label>证件类型：</label><select flag="paperCode" id="paperTypeByUpdatePersonal" name="paperType" class="" ></select></p>			
		</div>
		<div class="col-md-4 col-sm-12" >
			<p>
			<label>证件号码：</label><input  name="paperNo"  class="validIdentity" type="text" size="26" />
			</p>
		</div>
		<div class="col-md-4 col-sm-12" >
			<p>
			<label>手机号码：</label><input  name="mobile"  class="" type="text" size="26"/>
			</p>
		</div>
		</div>
		<div class="subBar">
			<ul> 
				<li>
				<div class="buttonActive" ><div class="buttonContent" ><button type="submit">查询</button></div></div>
				</li>
			</ul>
		</div>
		</div>
	</form>	
</div>

<form method="post" action="personalInfo/goUpdatePersonalRegister" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone);">		
	<div class="pageContent">
	<div id="ByPersonalInfo">
		<table class="table" width="100%" layoutH="298">
			<thead>
				<tr align="center">
					<th width="3%">选择</th>
					<th width="24%">姓名</th>
					<th width="24%" >证件类型</th>
					<th width="24%">证件号码</th>
					<th width="25%">手机号码</th>
				</tr>
			</thead>
			<tbody id="tbodyByPersonalInfo">
				
			</tbody>
		</table>
	</div>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<!--<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value},'lossCard',getLoosCardInfo)">
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select> -->
			<span id="totalCountBypersonalInfo"></span>
		</div>

		<!-- <div callback='getLoosCardInfo' id="paginationBypersonalInfo" rel="lossCard" class="pagination" targetType="navTab" totalCount="200" numPerPage="5" pageNumShown="5" currentPage="1"></div> -->

	</div>
	<div class="formBar">
			<ul> 
				<li>
					<div class="buttonActive" >
						<div class="buttonContent" ><button type="submit" onclick="return validateChechBoxByUpdataPersonal();">修改个人信息</button></div>	
					</div>
				</li>
			</ul>
	</div> 
</div>
	</form>

